package com.rongc.client.freight.base.model;

import com.rongc.client.core.LocalData;
import com.rongc.client.core.QuickApplication;
import com.rongc.client.core.utils.FileManager;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Bruce on 2017/7/9.
 */
public class TipListBean extends LocalData{
    List<TipTemp> tips;

    public TipListBean() {
        tips = new ArrayList<>();
    }

    public List<TipTemp> getTips() {
        return tips;
    }

    public void setTips(List<TipTemp> tips) {
        this.tips = tips;
    }

    public void add(TipTemp tip){
        boolean con = true;
        for (TipTemp temp : tips) {
            if(temp.getPoiID().equals(tip.getPoiID())){
                con = false;
                break;
            }
        }
        if(con)
            tips.add(tip);
    }

    public static TipListBean load() {
        return FileManager.loadData(QuickApplication.getInstance(), TipListBean.class);
    }

    public static void clear() {
        FileManager.clearData(QuickApplication.getInstance(), TipListBean.class);
    }
}
